﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace TskComment.Core
{
    public class Common
    {
        public static string GetValueAttribute(Type type, string itm)
        {
            MemberInfo[] members = type.GetMember(itm);

            string name = itm;
            object[] attrs = members[0].GetCustomAttributes(false);
            foreach (object attr in attrs)
            {
                if (attr is ValueAttribute)
                {
                    return ((ValueAttribute)attr).Value;
                }
            }

            return String.Empty;
        }
    }

    public class Region
    {
        public string Text { get; set; }
        public string Value { get; set; }

        public override string ToString()
        {
            return Text;
        }
    }
}
